<!--维修详情-->
<div class="wrap">
	<div class="header">
		<span id="return">返回上一级</span>
	</div>
	<!--详情内容-->
	<ul class="order_list">
		<li>
			<label>设备编号</label>
			<span id="sbNum"></span>
		</li>
		<li>
			<label>设备名称</label>
			<span id="sbName"></span>
		</li>
		<li>
			<label>负责人</label>
			<span id="pet_name"></span>
		</li>
		<li>
			<label>故障现象</label>
			<span id="gz_details"></span>
		</li>
		<li>
			<a href="javascript:void(0)" id="orderSubmit">确认</a>
		</li>
	</ul>
</div>
<script>
	//返回上一级
	$("#return").on("click",function(){
		$("#main").empty();
		$.ajax({
			type:"get",
			url:"repair.html",
			success:function(res){
				$("#main").append(res);
			}
		});
	})
	//用cookie获取id
	var id = $.cookie("id");
	$("#sbNum").text(id);
	//订单详情
	$.ajax({
		type:"post",
		url:"http://39.108.164.20/device/SysUser/SelDevRepair",
		dataType:"json",
		success:function(res){
			var data = res.result.data;
			for(let i=0;i<data.length;i++){
				if(id == data[i].sb_id){
					$("#sbNum").text(data[i].sb_id);
					$("#sbName").text(data[i].sb_name);
					$("#pet_name").text(data[i].pet_name);
					$("#gz_details").text(data[i].gz_details);
					$("#gz_comment").text(data[i].gz_comment);
					$("#creat_time").text(data[i].creat_time);
				}
			}
		}
	});
	//确认维修
	$("#orderSubmit").on("click",function(){
		$.ajax({
			type:"post",
			url:"http://39.108.164.20/device/SysUser/SureDevRepair",
			dataType:"json",
			data:{
				sb_id:id
			},
			success:function(res){
				alert(res.result.msg)
			}
		});
	})
